package com.ruoyi.finance.service.impl;

import java.util.List;

import com.ruoyi.finance.vo.GoodsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.finance.mapper.InvoiceGoodsMapper;
import com.ruoyi.finance.domain.InvoiceGoods;
import com.ruoyi.finance.service.IInvoiceGoodsService;

/**
 * 开票商品Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-25
 */
@Service
public class InvoiceGoodsServiceImpl implements IInvoiceGoodsService
{
    @Autowired
    private InvoiceGoodsMapper invoiceGoodsMapper;

    /**
     * 查询开票商品
     *
     * @param id 开票商品主键
     * @return 开票商品
     */
    @Override
    public InvoiceGoods selectInvoiceGoodsById(Long id)
    {
        return invoiceGoodsMapper.selectInvoiceGoodsById(id);
    }

    /**
     * 查询开票商品列表
     *
     * @param invoiceGoods 开票商品
     * @return 开票商品
     */
    @Override
    public List<InvoiceGoods> selectInvoiceGoodsList(InvoiceGoods invoiceGoods)
    {
        return invoiceGoodsMapper.selectInvoiceGoodsList(invoiceGoods);
    }

    /**
     * 新增开票商品
     *
     * @param invoiceGoods 开票商品
     * @return 结果
     */
    @Override
    public int insertInvoiceGoods(InvoiceGoods invoiceGoods)
    {
        return invoiceGoodsMapper.insertInvoiceGoods(invoiceGoods);
    }

    /**
     * 修改开票商品
     *
     * @param invoiceGoods 开票商品
     * @return 结果
     */
    @Override
    public int updateInvoiceGoods(InvoiceGoods invoiceGoods)
    {
        return invoiceGoodsMapper.updateInvoiceGoods(invoiceGoods);
    }

    /**
     * 批量删除开票商品
     *
     * @param ids 需要删除的开票商品主键
     * @return 结果
     */
    @Override
    public int deleteInvoiceGoodsByIds(Long[] ids)
    {
        return invoiceGoodsMapper.deleteInvoiceGoodsByIds(ids);
    }

    /**
     * 删除开票商品信息
     *
     * @param id 开票商品主键
     * @return 结果
     */
    @Override
    public int deleteInvoiceGoodsById(Long id)
    {
        return invoiceGoodsMapper.deleteInvoiceGoodsById(id);
    }

    @Override
    public String toadd(GoodsDto goodsDto) {
        return invoiceGoodsMapper.toadd(goodsDto);
    }
}
